package d_fileReader;

import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;

/**
 * @author Cheng-02
 * @version V1.0
 * @Package d_fileReader
 * @date 2024/4/12 下午7:02
 */
public class Test02 {
    public static void main(String[] args) {
        try {
            FileWriter fileWriter = new FileWriter("module10\\2.txt",true);
            fileWriter.write("123123123");
            fileWriter.close();

            FileReader fileReader = new FileReader("module10\\2.txt");

            char [] arr=new char[1024];
            int len;
            while((len=fileReader.read(arr))!=-1){
                System.out.println(new String(arr,0,len));
            }
        } catch (IOException e) {
            throw new RuntimeException(e);
        }
    }
}
